package com.srv.common;

import java.util.HashMap;
import java.util.Map;

import com.srv.util.ObjectField;
import com.srv.util.ObjectFieldDBType;
import com.srv.util.StringUtil;

public class IDField implements ObjectField{
	private static Map<String, IDField> map = new HashMap<String, IDField>();	
	public static final IDField PID = new IDField("PID", ObjectFieldDBType.LONG, false, false);
	public static final IDField ID = new IDField("ID", ObjectFieldDBType.STRING, false, true);
	public static final IDField CREATETIME = new IDField("CREATE_TIME", ObjectFieldDBType.TIMESTAMP, true, false);
	public static final IDField UPDATETIME = new IDField("UPDATE_TIME", ObjectFieldDBType.TIMESTAMP, true, false);
	public static final IDField TYPE = new IDField("TYPE", ObjectFieldDBType.INT, true, false);
	public static final IDField EXTEND_1 = new IDField("EXTEND_1", ObjectFieldDBType.STRING, true, false);
	public static final IDField EXTEND_2 = new IDField("EXTEND_2", ObjectFieldDBType.STRING, true, false);
	
	
	
	
	private String column;
    private ObjectFieldDBType type;
    private boolean modify = false;
    private boolean uniquene = false;
    
    public IDField(String cn, ObjectFieldDBType type, boolean modify, boolean uniquene) {
    	this.column = cn;
        this.type = type;
        this.modify = modify;
        this.uniquene = uniquene;

        map.put(this.column, this);
    }
    
    public String getColumn() {
        return column;
    }

    public ObjectFieldDBType getType() {
        return type;
    }

    public boolean isModify() {
        return modify;
    }

    public boolean isUniquene() {
        return uniquene;
    }
}
